package Ajax;

import java.io.PrintWriter;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import javax.servlet.http.HttpServletRequest;

public class CateEducation implements AjaxPage {
	private ResultSet rs = null;

	@Override
	public void execSql(Statement stmt, HttpServletRequest request)
			throws SQLException {
		String sql = "SELECT edu_name FROM edu_list";

		rs = stmt.executeQuery(sql);
	}

	@Override
	public void printXML(PrintWriter writer) throws SQLException {
		int i = 0;

		while (rs != null && rs.next()) {
			String str = rs.getString(1);

			writer.println("<li><input name=\"educationradio\" type=\"radio\" value=\"0\" onclick=\"category.parse('"
					+ ++i
					+ "','"
					+ str
					+ "');category.close()\" />"
					+ str
					+ "</li>");
		}
	}

	@Override
	public void printHtml(PrintWriter writer) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void printDel(PrintWriter writer) {
		// TODO Auto-generated method stub
		
	}
}
